<?php

namespace App\Admin\Extensions\Column\AmazonFile;

class FileDown
{
    protected $id;

    protected $prefix;

    public function __construct($id,$prefix)
    {
        $this->id = $id;
        $this->prefix = $prefix;
    }

    protected function render()
    {
        $html = <<<EOT
<a target="_blank" href="/xqc/{$this->prefix}/file-download?id={$this->id}" class="btn btn-xs btn-default"><i class="fa fa-download"> 下载</i></a>
EOT;
        return $html;
    }

    public function __toString()
    {
        return $this->render();
    }
}